home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / video / fly8111-.000 / fly8111- / fly8 / opaddoc.c < prev    next >
C/C++ Source or Header  |  1979-12-31  |  1KB  |  62 lines

  1. /* --------------------------------- opaddoc.c ------------------------------ */
  2.  
  3. /* This is part of the flight simulator 'fly8'.
  4.  * Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au).
  5. */
  6.  
  7. /* object: paddoc.
  8. */
  9.  
  10. #include "fly.h"
  11.  
  12.  
  13. #define S    400
  14.  
  15. LOCAL_FUNC int FAR
  16. paddoc_create (OBJECT *p)
  17. {
  18.     p->color = CC_GREEN;
  19.     p->time = FOREVER;
  20.     p->flags |= F_VISIBLE;
  21.     Mident (p->T);
  22.     return (0);
  23. }
  24.  
  25. extern int FAR
  26. paddoc_init (BODY *b)
  27. {
  28.     VERTEX    *v;
  29.  
  30.     b->title = "PADDOC";
  31.     b->flags |= BO_DYNSHAPE;
  32.     if (!NEW (b->shape))
  33.         return (1);
  34.     if (F(v = (VERTEX *) memory_calloc (sizeof (*v), 6))) {
  35.         DEL0(b->shape);
  36.         return (1);
  37.     }
  38.     b->shape->v = v;
  39.  
  40.     v->V[X] = -S;    v->V[Y] = -S;    v->flags = V_MOVE;    ++v;
  41.     v->V[X] = -S;    v->V[Y] =  S;    v->flags = V_DRAW;    ++v;
  42.     v->V[X] =  S;    v->V[Y] =  S;    v->flags = V_DRAW;    ++v;
  43.     v->V[X] =  S;    v->V[Y] = -S;    v->flags = V_DRAW;    ++v;
  44.     v->V[X] = -S;    v->V[Y] = -S;    v->flags = V_DRAW;    ++v;
  45.                     v->flags = 0;
  46.  
  47.     b->shape->extent = S;
  48.     b->shape->weight = 1L;
  49.     b->shape->drag = 0;
  50.     b->shape->flags = SH_DYNVERTEX;
  51.  
  52.     b->term = gen_term;
  53.     b->create = paddoc_create;
  54.     b->delete = gen_delete;
  55.     b->dynamics = gen_nodynamics;
  56.     b->hit = gen_hit;
  57.  
  58.     return (0);
  59. }
  60.  
  61. #undef S
  62.